package com.dgut.hisystem.controller;


import com.dgut.hisystem.entity.Advice;
import com.dgut.hisystem.service.AdviceService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RequestMapping("/advice")
@RestController
public class AdviceController {
    @Resource
    private AdviceService adviceService;

    @RequestMapping("/get")
    Advice getAdviceById(int id) {
        return adviceService.getAdviceById(id);
    }

    @RequestMapping("/insert")
    void insert(@RequestBody Advice advice) {
        adviceService.insert(advice);
    }

    @RequestMapping("/update")
    void update(@RequestBody Advice advice) {
        adviceService.update(advice);
    }

    @RequestMapping("/delete")
    void delete(int id) {
        adviceService.delete(id);
    }



}
